<?php
/**
 * 控制器类
 */
namespace core;
class Controller{

	private $params = array();
	// 向模板注入变量
	public function assign($name, $value) {
		$this->params[$name] = $value;
	}

	// 输出html
	public function fetch($file){

		if(!empty($this->params)) {
			// 提取变量
			extract($this->params, EXTR_OVERWRITE );
		}

		include VIEW . $file;
	}

}